<?php
include_once("db_connect.php");

$sql = "SELECT * FROM login_user";

$result = $mysqli->query($sql);

if ($result) {
    $userData = array();
    while ($row = $result->fetch_assoc()) {
        $userData[] = $row;
    }

    $response = array(
        'message' => 'Get Data User Successful',
        'users' => $userData,
    );

    echo json_encode($response);
} else {
    $data = array('message' => 'Get Data User Failed');
    echo json_encode($data);
}
?>